package com.xhwl.logistics.service.cent.server;

import com.alibaba.fastjson.JSON;
import com.xhwl.common.dto.cent.vehicle.feign.VehicleCarportQuery;
import com.xhwl.logistics.bo.VehicleCarportBO;
import com.xhwl.logistics.bo.input.QueryVehicleCarportBO;
import com.xhwl.logistics.converter.mapstruct.VehicleCarportConverter;
import com.xhwl.logistics.service.IVehicleCarportService;
import org.springframework.beans.factory.annotation.Autowired;

//@Service
public class VehicleCarportFeignServiceImpl implements IVehicleCarportFeignService {

    @Autowired
    private IVehicleCarportService vehicleCarportService;

    @Autowired
    private VehicleCarportConverter vehicleCarportConverter;

    @Override
    public String carport(VehicleCarportQuery vehicleCarportQuery) {

        QueryVehicleCarportBO queryVehicleCarportBO = vehicleCarportConverter.vehicleCarportQuery2QueryVehicleCarportBO(vehicleCarportQuery);
        VehicleCarportBO vehicleCarportBO = vehicleCarportService.queryCarport(queryVehicleCarportBO);

        return JSON.toJSONString(vehicleCarportConverter.vehicleCarportBO2VehicleCarportVO(vehicleCarportBO, queryVehicleCarportBO.getParkingLotName()));
    }

}
